home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / MacFormat 92 CD / Shareware Plus / Utilities / FolderSynchronizer 1.8.9 / PlugIn / Dialog / 00061_fMinute.ls < prev    next >
Encoding:
Text File  |  2000-04-17  |  866 b   |  37 lines

  1. on keyDown
  2.   global gMonth
  3.   if (the key = TAB) or (the key = RETURN) then
  4.     if value(field "fHour") > 23 then
  5.       beep()
  6.     end if
  7.     set the selEnd to length(field "fMinute")
  8.     set the selStart to 0
  9.     pass()
  10.   end if
  11.   if ((the keyCode >= 123) and (the keyCode <= 126)) or (the keyCode = 51) then
  12.     pass()
  13.   end if
  14.   set myNum to value(the key)
  15.   if voidp(myNum) then
  16.     exit
  17.   end if
  18.   set myTempNum to field "fMinute"
  19.   set s to the selStart
  20.   set e to the selEnd
  21.   set the selEnd to s + 1
  22.   set the selStart to s + 1
  23.   if s <> e then
  24.     set s to s + 1
  25.     put the key into char s to e of myTempNum
  26.   else
  27.     if s = 0 then
  28.       put the key before myTempNum
  29.     else
  30.       put the key after char s of myTempNum
  31.     end if
  32.   end if
  33.   if (value(myTempNum) <= 59) and (length(myTempNum) <= 2) then
  34.     put myTempNum into field "fMinute"
  35.   end if
  36. end
  37.